.gems-input {
  --gems-input-text-color: var(--gems-text-color-regular);
  --gems-input-border: var(--gems-border);
  --gems-input-hover-border: var(--gems-border-color-hover);
  --gems-input-focus-border: var(--gems-color-primary);
  --gems-input-transparent-border: 0 0 0 1px transparent inset;
  --gems-input-border-color: var(--gems-border-color);
  --gems-input-border-radius: var(--gems-border-radius-base);
  --gems-input-bg-color: var(--gems-fill-color-blank);
  --gems-input-icon-color: var(--gems-text-color-placeholder);
  --gems-input-placeholder-color: var(--gems-text-color-placeholder);
  --gems-input-hover-border-color: var(--gems-border-color-hover);
  --gems-input-clear-hover-color: var(--gems-text-color-secondary);
  --gems-input-focus-border-color: var(--gems-color-primary);
}

.gems-input {
  --gems-input-height: var(--gems-component-size);
  position: relative;
  font-size: var(--gems-font-size-base);
  display: inline-flex;
  width: 100%;
  line-height: var(--gems-input-height);
  box-sizing: border-box;
  vertical-align: middle;
  &.is-disabled {
    cursor: not-allowed;
    .gems-input__wrapper {
      background-color: var(--gems-disabled-bg-color);
      box-shadow: 0 0 0 1px var(--gems-disabled-border-color) inset;
    }
    .gems-input__inner {
      color: var(--gems-disabled-text-color);
      -webkit-text-fill-color: var(--gems-disabled-text-color);
      cursor: not-allowed;
    }
    .gems-textarea__inner {
      background-color: var(--gems-disabled-bg-color);
      box-shadow: 0 0 0 1px var(--gems-disabled-border-color) inset;
      color: var(--gems-disabled-text-color);
      -webkit-text-fill-color: var(--gems-disabled-text-color);
      cursor: not-allowed;
    }
  }
  &.is-prepend {
    >.gems-input__wrapper {
      border-top-left-radius: 0;
      border-bottom-left-radius: 0;
    }
  }
  &.is-append {
    >.gems-input__wrapper {
      border-top-right-radius: 0;
      border-bottom-right-radius: 0;
    }
  }
}

.gems-input--large {
  --gems-input-height: var(--gems-component-size-large);
  font-size: 14px;
  .gems-input__wrapper {
    padding: 1px 15px;
    .gems-input__inner {
      --gems-input-inner-height: calc(var(--gems-input-height, 40px) - 2px);
    }
  }

}
.gems-input--small {
  --gems-input-height: var(--gems-component-size-small);
  font-size: 12px;
  .gems-input__wrapper {
    padding: 1px 7px;
    .gems-input__inner {
      --gems-input-inner-height: calc(var(--gems-input-height, 24px) - 2px);
    } 
  }
}
.gems-input__prefix, .gems-input__suffix {
  display: inline-flex;
  white-space: nowrap;
  flex-shrink: 0;
  flex-wrap: nowrap;
  height: 100%;
  text-align: center;
  color: var(--gems-input-icon-color, var(--gems-text-color-placeholder));
  transition: all var(--gems-transition-duration);
}
.gems-input__prefix {
  >:first-child {
    margin-left: 0px !important;
  }
  >:last-child {
    margin-right: 8px !important;
  }
}
.gems-input__suffix {
  >:first-child {
    margin-left: 8px !important;
  }
  >:last-child {
    margin-right: 0px !important;
  }
}
.gems-input__prepend, .gems-input__append {
  background-color: var(--gems-fill-color-light);
  color: var(--gems-color-info);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  border-radius: var(--gems-input-border-radius);
  padding: 0 20px;
  white-space: nowrap;
}
.gems-input__prepend {
  border-right: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  box-shadow: 1px 0 0 0 var(--gems-input-border-color) inset,0 1px 0 0 var(--gems-input-border-color) inset,0 -1px 0 0 var(--gems-input-border-color) inset;

}
.gems-input__append {
  border-left: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  box-shadow: 0 1px 0 0 var(--gems-input-border-color) inset,0 -1px 0 0 var(--gems-input-border-color) inset,-1px 0 0 0 var(--gems-input-border-color) inset;
  & >.gems-input__wrapper {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }
}

.gems-input--textarea {
  position: relative;
  display: inline-block;
  width: 100%;
  vertical-align: bottom;
  font-size: var(--gems-font-size-base);
}
.gems-textarea__wrapper {
  position: relative;
  display: block;
  resize: vertical;
  padding: 5px 11px;
  line-height: 1.5;
  box-sizing: border-box;
  width: 100%;
  font-size: inherit;
  font-family: inherit;
  color: var(--gems-input-text-color, var(--gems-text-color-regular));
  background-color: var(--gems-input-bg-color, var(--gems-fill-color-blank));
  background-image: none;
  -webkit-appearance: none;
  box-shadow: 0 0 0 1px var(--gems-input-border-color, var(--gems-border-color)) inset;
  border-radius: var(--gems-input-border-radius, var(--gems-border-radius-base));
  transition: var(--gems-transition-box-shadow);
  border: none;
  &:focus {
    outline: none;
    box-shadow: 0 0 0 1px var(--gems-input-focus-border-color) inset;
  }
  &::placeholder {
    color: var(--gems-input-placeholder-color);
  }
}
.gems-input__wrapper {
  display: inline-flex;
  flex-grow: 1;
  align-items: center;
  justify-content: center;
  padding: 1px 11px;
  background-color: var(--gems-input-bg-color, var(--gems-fill-color-blank));
  background-image: none;
  border-radius: var(--gems-input-border-radius, var(--gems-border-radius-base));
  transition: var(--gems-transition-box-shadow);
  box-shadow: 0 0 0 1px var(--gems-input-border-color, var(--gems-border-color)) inset;
  &:hover {
    box-shadow: 0 0 0 1px var(--gems-input-hover-border-color) inset;
  }
  &.is-focus {
    box-shadow: 0 0 0 1px var(--gems-input-focus-border-color) inset;
  }
  .gems-input__inner {
    --gems-input-inner-height: calc(var(--gems-input-height, 32px) - 2px);
    width: 100%;
    flex-grow: 1;
    -webkit-appearance: none;
    color: var(--gems-input-text-color, var(--gems-text-color-regular));
    font-size: inherit;
    height: var(--gems-input-inner-height);
    line-height: var(--gems-input-inner-height);
    padding: 0;
    outline: none;
    border: none;
    background: none;
    box-sizing: border-box;
    &::placeholder {
      color: var(--gems-input-placeholder-color);
    }
  }  
  .gems-icon {
    height: inherit;
    line-height: inherit;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all var(--gems-transition-duration);
    margin-left: 8px;
  }
  .gems-input__clear, .gems-input__password {
    color: var(--gems-input-icon-color);
    font-size: 14px;
    cursor: pointer;
    &:hover {
     color: var(--gems-input-clear-hover-color);
    }
  }
}

